package kevin.hbase.task;

import kevin.hbase.service.DeviceService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

import javax.annotation.PostConstruct;

@Component
@Slf4j
@EnableScheduling
public class ApiScheduledTask {
    @Autowired
    private DeviceService deviceService;

    @PostConstruct
    public void init() {
    }

    @Scheduled(cron = "${task.versionReport.cron}")
    public void flyPointTimer() {
        deviceService.sendVersionReport();
    }

}
